#if !defined(AFX_SETTINGAGVDLG_H__9046044C_351E_442F_AEDD_EA9B773F60B9__INCLUDED_)
#define AFX_SETTINGAGVDLG_H__9046044C_351E_442F_AEDD_EA9B773F60B9__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SettingAGVDlg.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CSettingAGVDlg dialog
#include "Util/MinButton.h"
#include "Util\MinLabel.h"

class IComThread;
class IIO;

class CSettingAGVDlg : public CDialog
{
// Construction
public:
	void ButtonInitial();
	CSettingAGVDlg(IIO *pIO, CWnd* pParent = NULL);   // standard constructor

	UINT m_nTimerID;
	IIO* m_lnkIO;
	BOOL m_TimerInitFlag;
	BOOL m_flgComPortOpen;

	int m_nInOldSts[40];
	int m_nInSts[40];
	int m_nOutOldSts[40];
	int m_nOutSts[40];

	
	CMinButton m_bInput[8];
	CMinButton m_bOutput[8];
	CMinLabel	m_sData[2];

	char m_szTmp[100];
	void Display(BOOL change=TRUE);
	
	CString strPIOAddress;
	CString strPIOChannel;

// Dialog Data
	//{{AFX_DATA(CSettingAGVDlg)
	enum { IDD = IDD_SETTING_AGV };
	CMinButton	m_bExit;
	CMinButton m_bInput1;
	CMinButton m_bInput2;
	CMinButton m_bInput3;
	CMinButton m_bInput4;
	CMinButton m_bInput5;
	CMinButton m_bInput6;
	CMinButton m_bInput7;
	CMinButton m_bInput8;
	CMinButton m_bOutput1;
	CMinButton m_bOutput2;
	CMinButton m_bOutput3;
	CMinButton m_bOutput4;
	CMinButton m_bOutput5;
	CMinButton m_bOutput6;
	CMinButton m_bOutput7;
	CMinButton m_bOutput8;
	CMinButton	m_bChanWriting;
	CMinButton	m_bChanSet;
	CMinButton	m_bChanRead;
	CMinButton	m_bAddrWriting;
	CMinButton	m_bAddrSet;
	CMinButton	m_bAddrRead;
	//}}AFX_DATA


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CSettingAGVDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

protected:
	void ComPortOpen();
	void ComPortClose();

// Implementation
protected:
	IComThread* m_pPort2RFPIO;
	// Generated message map functions
	//{{AFX_MSG(CSettingAGVDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnExit();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnOutput1();
	afx_msg void OnDestroy();
	afx_msg void OnOutput2();
	afx_msg void OnOutput3();
	afx_msg void OnOutput4();
	afx_msg void OnOutput5();
	afx_msg void OnOutput6();
	afx_msg void OnOutput7();
	afx_msg void OnOutput8();
	afx_msg void OnAddressSet();
	afx_msg void OnChannelSet();
	afx_msg void OnAddressWriting();
	afx_msg void OnChannelWriting();
	afx_msg void OnAddressRead();
	afx_msg void OnChannelRead();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_SETTINGAGVDLG_H__9046044C_351E_442F_AEDD_EA9B773F60B9__INCLUDED_)
